// 获取所有角色列表

import type { PageParams } from "@/types/common"
import type { Role, RoleData, RoleDetail, RoleUserData } from "@/types/system"
import { request } from "@/utils/reuqest"

export const getRoleListAPI= ()=>{
  return  request<Role[]>('/park/sys/role')
}

// 所有角色树形结构
export const getTreeListAPI = ()=>{
    return request<RoleData[]>('/park/sys/permision/all/tree')
}


// 
/**
 * 查询当前角色详情-权限和分配人数
 * @returns
 */
export const getRoleDetailAPI = (roleId: number) =>{
  return request<RoleDetail>(`/park/sys/role/${roleId}`)
}


export const getRoleUserAPI = (roleId: number, params?: PageParams) => {
  return request<RoleUserData>(`/park/sys/roleUser/${roleId}`, 'GET', params)
}